﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/adminpanel.master" AutoEventWireup="true"
    CodeFile="Admin_Product.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
   
    <script language="javascript" type="text/javascript">
       function validate() {
           var result = false;
           var upfile = document.getElementById("FileUpload1").value;
           if (upfile != "") {
               var accept = "png,gif,jpg,jpeg".split(',');
               var getExtention = upfile.split('.');
               var extention = getExtention[getExtention.length - 1];
               for (i = 0; i < accept.length; i++) {
                   if (accept[i] == extention) {
                       result = true;
                       break;
                   }
               }
               if (!result) {
                   alert("allowed file extetions are png,gif,jpg,jpeg");
               }

           }
           else {
               alert("select image to Upload");
           }
           return result;
       }
        </script>



    
<style type="text/css">
    .style1
    {
        font-family: "Times New Roman", Times, serif;
        height: 776px;
        width: 639px;
    }
    .style3
    {
        width: 207px;
    }
    .style5
    {
        width: 445px;
        font-family: Arial, Helvetica, sans-serif;
        text-align: left;
        font-weight: 700;
    }
    .style8
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: x-small;
    }
    .style9
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: medium;
        color: #000000;
    }
    .style10
    {
        width: 136px;
        font-family: Arial, Helvetica, sans-serif;
    }
    .style13
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: medium;
        width: 255px;
    }
    .style15
    {
        font-family: Arial, Helvetica, sans-serif;
        }
    .style16
    {
        width: 174px;
    }
    .style19
    {
        font-family: Arial, Helvetica, sans-serif;
        width: 174px;
        height: 32px;
    }
    .style22
    {
        width: 445px;
        font-family: Arial, Helvetica, sans-serif;
        height: 32px;
        font-weight: 700;
    }
    .style23
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: medium;
        width: 255px;
        height: 32px;
    }
    .style26
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: small;
        height: 32px;
        width: 136px;
    }
    .style27
    {
        width: 207px;
        height: 32px;
    }
    .style28
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: small;
        width: 255px;
    }
    .style31
    {
        font-family: Arial, Helvetica, sans-serif;
        width: 174px;
        height: 48px;
    }
    .style32
    {
        width: 445px;
        font-family: Arial, Helvetica, sans-serif;
        height: 48px;
        font-weight: 700;
    }
    .style33
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: medium;
        width: 255px;
        height: 48px;
    }
    .style36
    {
        height: 48px;
        width: 136px;
    }
    .style37
    {
        width: 207px;
        height: 48px;
    }
    .style38
    {
        width: 340px;
    }
    .style39
    {
        width: 340px;
        height: 32px;
    }
    .style40
    {
        width: 340px;
        height: 48px;
    }
    .style41
    {
        width: 136px;
    }
    .style42
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: x-small;
        width: 136px;
    }
    .style43
    {
        width: 510px;
        font-family: Arial, Helvetica, sans-serif;
        text-align: left;
        font-weight: 700;
    }
    .style44
    {
        width: 510px;
        font-family: Arial, Helvetica, sans-serif;
        height: 32px;
        font-weight: 700;
    }
    .style45
    {
        width: 510px;
        font-family: Arial, Helvetica, sans-serif;
        height: 48px;
        font-weight: 700;
    }
    .style46
    {
        width: 525px;
        font-family: Arial, Helvetica, sans-serif;
    }
    .style47
    {
        width: 525px;
        font-family: Arial, Helvetica, sans-serif;
        height: 32px;
    }
    .style48
    {
        width: 525px;
        font-family: Arial, Helvetica, sans-serif;
        height: 48px;
    }
    .style49
    {
        font-family: Arial, Helvetica, sans-serif;
        width: 174px;
        height: 1px;
    }
    .style50
    {
        width: 445px;
        font-family: Arial, Helvetica, sans-serif;
        height: 1px;
    }
    .style51
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: medium;
        width: 255px;
        height: 1px;
    }
    .style52
    {
        width: 525px;
        font-family: Arial, Helvetica, sans-serif;
        height: 1px;
    }
    .style53
    {
        width: 510px;
        font-family: Arial, Helvetica, sans-serif;
        height: 1px;
    }
    .style54
    {
        height: 1px;
        width: 136px;
    }
    .style55
    {
        width: 340px;
        height: 1px;
    }
    .style56
    {
        width: 207px;
        height: 1px;
    }
    .style58
    {
        width: 445px;
        font-family: Arial, Helvetica, sans-serif;
        text-align: left;
        font-weight: 700;
        height: 20px;
    }
    .style61
    {
        width: 510px;
        font-family: Arial, Helvetica, sans-serif;
        text-align: left;
        font-weight: 700;
        height: 20px;
    }
    .style62
    {
        font-family: Arial, Helvetica, sans-serif;
        width: 174px;
        height: 20px;
    }
    .style63
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: medium;
        width: 255px;
        height: 20px;
    }
    .style64
    {
        width: 525px;
        font-family: Arial, Helvetica, sans-serif;
        height: 20px;
    }
    .style65
    {
        height: 20px;
        width: 136px;
    }
    .style66
    {
        width: 340px;
        height: 20px;
    }
    .style67
    {
        width: 207px;
        height: 20px;
    }
    .style79
    {
        font-family: Arial, Helvetica, sans-serif;
        width: 174px;
        height: 5px;
    }
    .style80
    {
        width: 445px;
        font-family: Arial, Helvetica, sans-serif;
        text-align: left;
        font-weight: 700;
        height: 5px;
    }
    .style81
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: medium;
        width: 255px;
        height: 5px;
    }
    .style82
    {
        width: 525px;
        font-family: Arial, Helvetica, sans-serif;
        height: 5px;
    }
    .style83
    {
        width: 510px;
        font-family: Arial, Helvetica, sans-serif;
        text-align: left;
        font-weight: 700;
        height: 5px;
    }
    .style84
    {
        font-family: Arial, Helvetica, sans-serif;
        font-size: x-small;
        width: 136px;
        height: 5px;
    }
    .style85
    {
        width: 340px;
        height: 5px;
    }
    .style86
    {
        width: 207px;
        height: 5px;
    }
</style>



    
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
     <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
     </telerik:RadStyleSheetManager>
<table class="style1">
        <tr>
            <td class="style15">
                &nbsp;</td>
            <td class="style5">
                <span class="style8"></td>
            <td class="style13">
                &nbsp;</td>
            <td class="style46">
                &nbsp;</td>
            <td class="style43">
                &nbsp;</td>
            <td class="style41">
                &nbsp;</td>
            <td class="style38">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style15">
                </span></td>
            <td class="style9" colspan="2">
                <strong>Add New Product</strong></td>
            <td class="style46">
                &nbsp;</td>
            <td class="style43">
                &nbsp;</td>
            <td class="style41">
                &nbsp;</td>
            <td class="style38">
                </span></td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style15">
                &nbsp;</td>
            <td class="style5" >
                &nbsp;</td>
            <td class="style28" >
                <asp:Label ID="errormsg" runat="server" style="color: #FF0000; font-weight: 700;" 
                    CssClass="style8"></asp:Label>
            </td>
            <td class="style46">
                &nbsp;</td>
            <td class="style43">
                &nbsp;</td>
            <td class="style42">
                &nbsp;</td>
            <td class="style38">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style62">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                &nbsp;</td>
            <td class="style58">
                <asp:Label ID="Label3" runat="server" Text="Product ID" Width="100px"></asp:Label>
            </td>
            <td class="style63">
                <asp:TextBox ID="TextBoxProductID" runat="server" CssClass="style8" 
                    Width="200px" BackColor="#CED4DF" Height="22px"></asp:TextBox>
                <br />
            </td>
            <td class="style64">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="TextBoxProductID" ErrorMessage="Please Enter Product ID" 
                    ForeColor="Red" CssClass="style8" Width="140px"></asp:RequiredFieldValidator>
            </td>
            <td class="style61">
                <asp:Label ID="Label2" runat="server" Text="Product Code" Width="140px"></asp:Label>
            </td>
            <td class="style65">
                <asp:DropDownList ID="productcode" runat="server" Height="28px" Width="200px" 
                    CssClass="style8" BackColor="#CED4DF">
                    <asp:ListItem>A</asp:ListItem>
                    <asp:ListItem>B</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="style66">
                </td>
            <td class="style67">
                </td>
        </tr>
        <tr>
            <td class="style15">
                </td>
            <td class="style5">
                Product Name</td>
            <td class="style13">
                <asp:TextBox ID="TextBoxProductname" runat="server" Width="200px" 
                    CssClass="style8" BackColor="#CED4DF" Height="22px"></asp:TextBox>
                <br />
            </td>
            <td class="style46">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="TextBoxProductname" ErrorMessage="Please Enter Product Name" 
                    ForeColor="Red" CssClass="style8"></asp:RequiredFieldValidator>
            </td>
            <td class="style43">
                Product Category</td>
            <td class="style41">
                <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="category" 
                    DataTextField="Cat_Name" DataValueField="Cat_ID" CssClass="style8" 
                    Width="200px" BackColor="#CED4DF" Height="22px">
                </asp:DropDownList>
                <asp:LinqDataSource ID="category" runat="server" 
                    ContextTypeName="bestlifeDataContext" EntityTypeName="" 
                    onselecting="category_Selecting" Select="new (Cat_ID, Cat_Name)" 
                    TableName="Tbl_Categories">
                </asp:LinqDataSource>
            </td>
            <td class="style38">
                </td>
            <td class="style3">
                </td>
        </tr>
        <tr>
            <td class="style79">
                </td>
            <td class="style80">
                Description</td>
            <td class="style81">
                <asp:TextBox ID="TextBoxdescription" runat="server" Width="200px" 
                    BackColor="#CED4DF" Height="22px"></asp:TextBox>
            </td>
            <td class="style82">
                </td>
            <td class="style83">
                </td>
            <td class="style84">
                </td>
            <td class="style85">
                </td>
            <td class="style86">
                </td>
        </tr>
        <tr>
            <td class="style19">
                </td>
            <td class="style22">
                Product Type</td>
            <td class="style23">
                <asp:TextBox ID="TextBoxproducttype" runat="server" Width="200px" 
                    CssClass="style8" BackColor="#CED4DF" Height="22px"></asp:TextBox>
                <br />
            </td>
            <td class="style47">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="TextBoxproducttype" ErrorMessage="Please Enter Product Type" 
                    ForeColor="Red" CssClass="style8"></asp:RequiredFieldValidator>
            </td>
            <td class="style44">
                Business Volume(BV)</td>
            <td class="style26">
                <asp:TextBox ID="TextBoxbv" runat="server" Width="200px" CssClass="style8" 
                    BackColor="#CED4DF" Height="22px"></asp:TextBox>
                <br />
            </td>
            <td class="style39">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                    ControlToValidate="TextBoxbv" 
                    ErrorMessage="Please Enter Business Volume of the Product" ForeColor="Red" 
                    style="font-family: Arial, Helvetica, sans-serif; font-size: x-small" 
                    Width="160px"></asp:RequiredFieldValidator>
            </td>
            <td class="style27">
                </td>
        </tr>
        <tr>
            <td class="style31">
                </td>
            <td class="style32">
                Product Price</td>
            <td class="style33">
                <asp:TextBox ID="TextBoxproductprice" runat="server" CssClass="style8" 
                    Width="200px" BackColor="#CED4DF" Height="22px"></asp:TextBox>
                <br />
            </td>
            <td class="style48">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="TextBoxproductprice" 
                    ErrorMessage="Please Enter Product Price" ForeColor="Red" 
                    CssClass="style8"></asp:RequiredFieldValidator>
            </td>
            <td class="style45">
                Point Volume(PV)</td>
            <td class="style36">
                <asp:TextBox ID="TextBoxpv" runat="server" Width="200px" CssClass="style8" 
                    BackColor="#CED4DF" Height="22px"></asp:TextBox>
                <br />
            </td>
            <td class="style40">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ControlToValidate="TextBoxpv" 
                    ErrorMessage="Please Enter Point Volume of the Product" ForeColor="Red" 
                    style="font-family: Arial, Helvetica, sans-serif; font-size: x-small"></asp:RequiredFieldValidator>
            </td>
            <td class="style37">
                </td>
        </tr>
        <tr>
            <td class="style49">
                </td>
            <td class="style50">
                </td>
            <td class="style51">
            </td>
            <td class="style52">
            </td>
            <td class="style53">
                </td>
            <td class="style54">
            </td>
            <td class="style55">
            </td>
            <td class="style56">
                </td>
        </tr>
        <tr>
            <td class="style15">
                &nbsp;</td>
            <td class="style5">
                Product Image</td>
            <td class="style28">
                <asp:FileUpload ID="FileUpload2" runat="server" Width="200px" 
                    CssClass="style8" Height="27px" />
                <br />
                <asp:FileUpload ID="FileUpload1" runat="server" Width="200px" 
                    CssClass="style8" Height="27px"    />
                
                <br />
                <asp:FileUpload ID="FileUpload3" runat="server" Width="200px" 
                    CssClass="style8" Height="27px"   />
            </td>
            <td class="style46">
                &nbsp;</td>
            <td class="style43">
                &nbsp;</td>
            <td class="style41">
                &nbsp;</td>
            <td class="style38">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style15">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td class="style28">
                &nbsp;</td>
            <td class="style46">
                &nbsp;</td>
            <td class="style43">
                &nbsp;</td>
            <td class="style42">
                &nbsp;</td>
            <td class="style38">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style15">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td class="style13">
               <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
               OnClientClick="return validate();"  Text="Add Product" CssClass="style8" 
                    Width="100px" BackColor="#CED4DF" Height="28px" />
                
            </td>
            <td class="style46">
                <asp:Button ID="Button2" runat="server" BackColor="#CED4DF" Height="28px" 
                    onclick="Button2_Click" 
                    style="font-family: Arial, Helvetica, sans-serif; font-size: x-small" 
                    Text="Cancel" Width="100px" />
            </td>
            <td class="style43">
                &nbsp;</td>
            <td class="style42">
                &nbsp;</td>
            <td class="style38">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style15">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td class="style13">
                &nbsp;</td>
            <td class="style46">
                &nbsp;</td>
            <td class="style43">
                &nbsp;</td>
            <td class="style42">
                &nbsp;</td>
            <td class="style38">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style15" colspan="6">
                &nbsp;</td>
            <td class="style38">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        </table>
</asp:Content>
